package com.hl.rpc

/**
  * Created by yuanhailong on 2021/10/10.
  */
class RemoteMessage extends Serializable


/**
  * Worker向Master注册的消息
  * @param workderId workerId
  * @param memory  内存
  * @param cores 合数
  */
case class RegisterWorker(workderId:String,memory:Int,cores:Int) extends RemoteMessage

/**
  * Master通知Worker接收到了注册，并向worker提供Master地址
  * @param masterURL
  */
case class RegisteredWorker(masterURL:String) extends RemoteMessage

/**
  * Worker向Master发送心跳信息
  * @param workerId
  */
case class HeartBeat(workerId:String) extends RemoteMessage

/**
  * 自己给自己发送消息的消息类型
  */
case object SelfSendHeart


/**
  * Master 给自己发送消息，用于定时清理过期的worker
  */
case object CheckTimeoutHeartBeat extends RemoteMessage

